Liveness Check v2 (Deprecated)
Input image requirement
For video
- The input video does not exceed 10MB and has the minimum resolution of 800x600 to ensure accuracy
- The face area must take up at least 3/5 the total video frame
- The video is 5-10 seconds long.
For attached image (to compare the face)
-
The image to be compared with video does not exceed 5MB and has the minimum resolution of 800x600.
-
The face area must take up at least 3/5 the total image
API Information
Request Url
POST https://api.fpt.ai/dmp/checklive/v2
Request Headers
| Parameter | Required | Default | Description |
|---|---|---|---|
| api_key | Yes | your api_key (from console.fpt.ai) |
Request Body
FormData containing the video and image to be checked
| Parameter | Required | Description |
|---|---|---|
| video | Yes | Video of customer’s face naturally moving |
| cmnd | No | Image to be compared with the straightest face in video |
| detect_mask | Optional | Detect face with mask in video |
Sample Request
curl --location --request POST 'https://api.fpt.ai/dmp/checklive/v2' \
--header 'api-key: xxxxxxxx' \
--form 'video=@"/video.mp4"' \
--form 'cmnd=@"/face.jpg"'
Response
JSON
{
"code": "200",
"message": "request successful.",
"is_live": true,
"prob": "0.006677149",
"need_to_review": false,
"is_deepfake": false,
"deepfake_prob": "0.0016087113",
"face_match": {
"isMatch": false,
"similarity": 1.8187788133647025
},
"face_match_error": {}
}
Returned Information
| Fields | Description |
|---|---|
| code | Code/Error |
| is_live | Video authentication result |
| is_deepfake | Deepfake detection result |
| face_match | Face matching result |
| face_match_error | Face matching error (if any) |
Code
| Code | Meaning |
|---|---|
| 200 | No error, see more results in the above fields |
| 406 | Face in video is wearing mask (optional) |
| 408 | More than 1 face in the video |
| 409 | No video uploaded/Wrong extension |
| 410 | No/Lost face in the video |
| 411 | The face is too small |
| 412 | The face is too blurry |
| 413 | Video is still image |
| 414 | Resolution of video is too low. Video is too short/long |
Sample Response: Success
{
"code": "200",
"message": "request successful.",
"is_live": true,
"prob": "0.006677149",
"need_to_review": false,
"is_deepfake": false,
"deepfake_prob": "0.0016087113",
"face_match": {
"isMatch": false,
"similarity": 81.81878813647025
}
}
Sample Response: Error
{
"code": "200",
"message": "request successful.",
"is_live": true,
"prob": "0.006677149",
"need_to_review": false,
"is_deepfake": false,
"deepfake_prob": "0.0016087113",
"face_match_error": {
"code": "407",
"data": "No faces detected"
}
}
{
"code": "200",
"message": "request successful.",
"is_live": true,
"prob": "0.1212767",
"need_to_review": true,
"is_deepfake": true,
"deepfake_prob": "0.99999964",
"face_match": {
"isMatch": false,
"similarity": 8.060021979547948
}
}
{
"code": "200",
"message": "request successful.",
"is_live": false,
"prob": "0.9255054",
"need_to_review": false,
"face_match": {
"isMatch": false,
"similarity": 22.457926631125535
}
}
{
"code": "406",
"message": "request successful.",
"is_live": false,
"need_to_review": false,
"data": "Face in video is wearing mask"
}
{
"code": "408",
"message": "request successful.",
"data": "2 faces"
}
{
"code": "409",
"message": "request successful.",
"data": "Allowed extensions are mov, mp4, mkv, webm"
}
{
"code": "410",
"message": "request successful.",
"data": "No faces"
}
{
"code": "411",
"message": "request successful.",
"is_live": false,
"need_to_review": false
}
{
"code": "412",
"message": "request successful.",
"is_live": false,
"need_to_review": false
}
{
"code": "413",
"message": "request successful.",
"is_live": false,
"need_to_review": false
}
{
"code": "414",
"message": "request successful.",
"data": "Resolution of video is too low"
}